package com.cande.loki.exercise.javabasic;

import java.time.Instant;

/**
 * @BelongsProject: loki
 * @BelongsPackage: com.cande.loki.exercise.javabasic
 * @Author: WANGAOFEI
 * @CreateTime: 2023-08-04  10:38
 * @Description: TODO
 * @Version: 1.0
 */
public class TimeTest {
    public static void main(String[] args) {
        Instant now =Instant.now();
        System.out.println(now);
        System.out.println("纪元秒"+now.getEpochSecond());
        System.out.println("时间戳"+System.currentTimeMillis());
        System.out.println("毫秒"+now.toEpochMilli());
        System.out.println("纳秒"+now.getNano());
        // true
        System.out.println(System.currentTimeMillis() == Instant.now().toEpochMilli());
    }

}
